package com.yugao.fintech.draper.scheduled.controller;

import com.yugao.fintech.draper.core.model.ResultVO;
import com.yugao.fintech.draper.datasource.entity.PageResult;
import com.yugao.fintech.draper.scheduled.dto.QuartzJobLogDTO;
import com.yugao.fintech.draper.scheduled.dto.QuartzJobLogQuery;
import com.yugao.fintech.draper.scheduled.service.QuartzJobLogService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 定时任务调度日志
 */
@RestController
@RequestMapping("/jobLog")
@RequiredArgsConstructor
public class QuartzJobLogController {
	private final QuartzJobLogService quartzJobLogService;

	@GetMapping(value = "/page")
	public ResultVO<PageResult<QuartzJobLogDTO>> page(QuartzJobLogQuery quartzJobLogQueryVo) {
		return ResultVO.success(PageResult.success(quartzJobLogService.page(quartzJobLogQueryVo)));
	}

	@GetMapping(value = "/findById")
	public ResultVO<QuartzJobLogDTO> findById(Long id) {
		return ResultVO.success(quartzJobLogService.findById(id));
	}
}